home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / AppleGuide.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  7.3 KB  |  344 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AppleGuide.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__APPLEGUIDE__') = 'UNDEFINED' THEN
  18. __APPLEGUIDE__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  22.     include 'AppleEvents.a'
  23.     ENDIF
  24. ;        include 'Errors.a'                                            ;
  25. ;            include 'ConditionalMacros.a'                            ;
  26. ;        include 'Types.a'                                            ;
  27. ;        include 'Memory.a'                                            ;
  28. ;            include 'MixedMode.a'                                    ;
  29. ;        include 'OSUtils.a'                                        ;
  30. ;        include 'Events.a'                                            ;
  31. ;            include 'Quickdraw.a'                                    ;
  32. ;                include 'QuickdrawText.a'                            ;
  33. ;        include 'EPPC.a'                                            ;
  34. ;            include 'PPCToolbox.a'                                    ;
  35. ;                include 'AppleTalk.a'                                ;
  36. ;            include 'Processes.a'                                    ;
  37. ;                include 'Files.a'                                    ;
  38. ;        include 'Notification.a'                                    ;
  39. AGAppInfo                 RECORD    0
  40. eventId                     ds.l    1
  41. refCon                     ds.l    1
  42. contextObj                 ds.l    1                                    ; private system field
  43. sizeof                     EQU    12
  44.                         ENDR
  45.  
  46.  
  47. gestaltAppleGuidePresent        EQU        31
  48. gestaltAppleGuideIsDebug        EQU        30
  49. kAGDefault                        EQU        0
  50. kAGFrontDatabase                EQU        1
  51. kAGNoMixin                        EQU        (-1)
  52.  
  53. kAGViewFullHowdy                EQU        1                    ; Full-size Howdy
  54. kAGViewTopicAreas                EQU        2                    ; Full-size Topic Areas
  55. kAGViewIndex                    EQU        3                    ; Full-size Index Terms
  56. kAGViewLookFor                    EQU        4                    ; Full-size Look-For (Search)
  57. kAGViewSingleHowdy                EQU        5                    ; Single-list-size Howdy
  58. kAGViewSingleTopics                EQU        6                    ; Single-list-size Topics
  59.  
  60. kAGFileMain                        EQU        'poco'
  61. kAGFileMixin                    EQU        'mixn'
  62.  
  63. ; To test against AGGetAvailableDBTypes
  64. kAGDBTypeBitAny                    EQU        $00000001
  65. kAGDBTypeBitHelp                EQU        $00000002
  66. kAGDBTypeBitTutorial            EQU        $00000004
  67. kAGDBTypeBitShortcuts            EQU        $00000008
  68. kAGDBTypeBitAbout                EQU        $00000010
  69. kAGDBTypeBitOther                EQU        $00000080
  70.  
  71. ; Returned by AGGetStatus
  72. kAGIsNotRunning                    EQU        0
  73. kAGIsSleeping                    EQU        1
  74. kAGIsActive                        EQU        2
  75.  
  76. ; Returned by AGGetFrontWindowKind
  77. kAGNoWindow                        EQU        0
  78. kAGAccessWindow                    EQU        1
  79. kAGPresentationWindow            EQU        2
  80.  
  81. ; Error Codes
  82. ; Not an enum, because other OSErrs are valid.
  83. ; Apple Guide error codes
  84. ; -------------------- Apple event reply codes
  85. kAGErrUnknownEvent                EQU        -2900
  86. kAGErrCantStartup                EQU        -2901
  87. kAGErrNoAccWin                    EQU        -2902
  88. kAGErrNoPreWin                    EQU        -2903
  89. kAGErrNoSequence                EQU        -2904
  90. kAGErrNotOopsSequence            EQU        -2905
  91. kAGErrReserved06                EQU        -2906
  92. kAGErrNoPanel                    EQU        -2907
  93. kAGErrContentNotFound            EQU        -2908
  94. kAGErrMissingString                EQU        -2909
  95. kAGErrInfoNotAvail                EQU        -2910
  96. kAGErrEventNotAvailable            EQU        -2911
  97. kAGErrCannotMakeCoach            EQU        -2912
  98. kAGErrSessionIDsNotMatch        EQU        -2913
  99. kAGErrMissingDatabaseSpec        EQU        -2914
  100. ; -------------------- Coach's Chalkboard reply codes
  101. kAGErrItemNotFound                EQU        -2925
  102. kAGErrBalloonResourceNotFound    EQU        -2926
  103. kAGErrChalkResourceNotFound        EQU        -2927
  104. kAGErrChdvResourceNotFound        EQU        -2928
  105. kAGErrAlreadyShowing            EQU        -2929
  106. kAGErrBalloonResourceSkip        EQU        -2930
  107. kAGErrItemNotVisible            EQU        -2931
  108. kAGErrReserved32                EQU        -2932
  109. kAGErrNotFrontProcess            EQU        -2933
  110. kAGErrMacroResourceNotFound        EQU        -2934
  111. ; -------------------- API reply codes
  112. kAGErrAppleGuideNotAvailable    EQU        -2951
  113. kAGErrCannotInitCoach            EQU        -2952
  114. kAGErrCannotInitContext            EQU        -2953
  115. kAGErrCannotOpenAliasFile        EQU        -2954
  116. kAGErrNoAliasResource            EQU        -2955
  117. kAGErrDatabaseNotAvailable        EQU        -2956
  118. kAGErrDatabaseNotOpen            EQU        -2957
  119. kAGErrMissingAppInfoHdl            EQU        -2958
  120. kAGErrMissingContextObject        EQU        -2959
  121. kAGErrInvalidRefNum                EQU        -2960
  122. kAGErrDatabaseOpen                EQU        -2961
  123. kAGErrInsufficientMemory        EQU        -2962
  124.  
  125. ; Events
  126. ; Not an enum because we want to make assignments.
  127. ; Handy events for AGGeneral.
  128. ; Panel actions (Require a presentation window).
  129. kAGEventDoCoach                    EQU        'doco'
  130. kAGEventDoHuh                    EQU        'dhuh'
  131. kAGEventGoNext                    EQU        'gonp'
  132. kAGEventGoPrev                    EQU        'gopp'
  133. kAGEventHidePanel                EQU        'pahi'
  134. kAGEventReturnBack                EQU        'gobk'
  135. kAGEventShowPanel                EQU        'pash'
  136. kAGEventTogglePanel                EQU        'patg'
  137.  
  138. ; Functions
  139. ; AGClose
  140. ; Close the database associated with the AGRefNum.
  141.     IF GENERATING68K THEN
  142.         Macro
  143.         _AGClose
  144.             moveq    #17,d0
  145.             dc.w     $AA6E
  146.         EndM
  147.     ELSE
  148.         IMPORT    AGClose
  149.     ENDIF
  150.  
  151. ; AGGeneral
  152. ; Cause various events to happen.
  153.     IF GENERATING68K THEN
  154.         Macro
  155.         _AGGeneral
  156.             moveq    #13,d0
  157.             dc.w     $AA6E
  158.         EndM
  159.     ELSE
  160.         IMPORT    AGGeneral
  161.     ENDIF
  162.  
  163. ; AGGetAvailableDBTypes
  164. ; Return the database types available for this application.
  165.     IF GENERATING68K THEN
  166.         Macro
  167.         _AGGetAvailableDBTypes
  168.             moveq    #8,d0
  169.             dc.w     $AA6E
  170.         EndM
  171.     ELSE
  172.         IMPORT    AGGetAvailableDBTypes
  173.     ENDIF
  174.  
  175. ; AGGetFrontWindowKind
  176. ; Return the kind of the front window.
  177.     IF GENERATING68K THEN
  178.         Macro
  179.         _AGGetFrontWindowKind
  180.             moveq    #12,d0
  181.             dc.w     $AA6E
  182.         EndM
  183.     ELSE
  184.         IMPORT    AGGetFrontWindowKind
  185.     ENDIF
  186.  
  187. ; AGGetFSSpec
  188. ; Return the FSSpec for the AGRefNum.
  189.     IF GENERATING68K THEN
  190.         Macro
  191.         _AGGetFSSpec
  192.             moveq    #15,d0
  193.             dc.w     $AA6E
  194.         EndM
  195.     ELSE
  196.         IMPORT    AGGetFSSpec
  197.     ENDIF
  198.  
  199. ; AGGetStatus
  200. ; Return the status of Apple Guide.
  201.     IF GENERATING68K THEN
  202.         Macro
  203.         _AGGetStatus
  204.             moveq    #9,d0
  205.             dc.w     $AA6E
  206.         EndM
  207.     ELSE
  208.         IMPORT    AGGetStatus
  209.     ENDIF
  210.  
  211. ; AGInstallCoachHandler
  212. ; Install a Coach object location query handler.
  213.     IF GENERATING68K THEN
  214.         Macro
  215.         _AGInstallCoachHandler
  216.             moveq    #18,d0
  217.             dc.w     $AA6E
  218.         EndM
  219.     ELSE
  220.         IMPORT    AGInstallCoachHandler
  221.     ENDIF
  222.  
  223. ; AGInstallContextHandler
  224. ; Install a context check query handler.
  225.     IF GENERATING68K THEN
  226.         Macro
  227.         _AGInstallContextHandler
  228.             moveq    #19,d0
  229.             dc.w     $AA6E
  230.         EndM
  231.     ELSE
  232.         IMPORT    AGInstallContextHandler
  233.     ENDIF
  234.  
  235. ; AGIsDatabaseOpen
  236. ; Return true if the database associated with the AGRefNum is open.
  237.     IF GENERATING68K THEN
  238.         Macro
  239.         _AGIsDatabaseOpen
  240.             moveq    #6,d0
  241.             dc.w     $AA6E
  242.         EndM
  243.     ELSE
  244.         IMPORT    AGIsDatabaseOpen
  245.     ENDIF
  246.  
  247. ; AGOpen
  248. ; Open a guide database.
  249.     IF GENERATING68K THEN
  250.         Macro
  251.         _AGOpen
  252.             moveq    #1,d0
  253.             dc.w     $AA6E
  254.         EndM
  255.     ELSE
  256.         IMPORT    AGOpen
  257.     ENDIF
  258.  
  259. ; AGOpenWithSearch
  260. ; Open a guide database and preset a search string.
  261.     IF GENERATING68K THEN
  262.         Macro
  263.         _AGOpenWithSearch
  264.             moveq    #2,d0
  265.             dc.w     $AA6E
  266.         EndM
  267.     ELSE
  268.         IMPORT    AGOpenWithSearch
  269.     ENDIF
  270.  
  271. ; AGOpenWithSequence
  272. ; Open a guide database and display a presentation window sequence.
  273.     IF GENERATING68K THEN
  274.         Macro
  275.         _AGOpenWithSequence
  276.             moveq    #4,d0
  277.             dc.w     $AA6E
  278.         EndM
  279.     ELSE
  280.         IMPORT    AGOpenWithSequence
  281.     ENDIF
  282.  
  283. ; AGOpenWithView
  284. ; Open a guide database and override the default view.
  285.     IF GENERATING68K THEN
  286.         Macro
  287.         _AGOpenWithView
  288.             moveq    #5,d0
  289.             dc.w     $AA6E
  290.         EndM
  291.     ELSE
  292.         IMPORT    AGOpenWithView
  293.     ENDIF
  294.  
  295. ; AGQuit
  296. ; Make Apple Guide quit.
  297.     IF GENERATING68K THEN
  298.         Macro
  299.         _AGQuit
  300.             moveq    #16,d0
  301.             dc.w     $AA6E
  302.         EndM
  303.     ELSE
  304.         IMPORT    AGQuit
  305.     ENDIF
  306.  
  307. ; AGRemoveCoachHandler
  308. ; Remove the Coach object location query handler.
  309.     IF GENERATING68K THEN
  310.         Macro
  311.         _AGRemoveCoachHandler
  312.             moveq    #20,d0
  313.             dc.w     $AA6E
  314.         EndM
  315.     ELSE
  316.         IMPORT    AGRemoveCoachHandler
  317.     ENDIF
  318.  
  319. ; AGRemoveContextHandler
  320. ; Remove the context check query handler.
  321.     IF GENERATING68K THEN
  322.         Macro
  323.         _AGRemoveContextHandler
  324.             moveq    #21,d0
  325.             dc.w     $AA6E
  326.         EndM
  327.     ELSE
  328.         IMPORT    AGRemoveContextHandler
  329.     ENDIF
  330.  
  331. ; AGStart
  332. ; Start up Apple Guide in the background.
  333.     IF GENERATING68K THEN
  334.         Macro
  335.         _AGStart
  336.             moveq    #10,d0
  337.             dc.w     $AA6E
  338.         EndM
  339.     ELSE
  340.         IMPORT    AGStart
  341.     ENDIF
  342.  
  343.     ENDIF ; __APPLEGUIDE__
  344.